package com.fs.repository;

import com.fs.entity.Friend;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;

import java.util.Collection;
import java.util.List;
import java.util.Set;

public interface FriendRepository extends JpaRepository<Friend,Integer>, JpaSpecificationExecutor<Friend> {

    @Modifying
    @Query("update Friend set name=?1, phone=?2 where id=?3")
    Integer updateFriend(String name, String phone, int friendId);

    Set<Friend> findByIdIn(Collection<Integer> id);


}
